package scala.EnumType

object MainOB {

   /*
    * Note : Scala treats Emum type not as Java or C#, it declares Enum type as Class 
    * so everytime you want to use enum type , extend Enumeration class
    */
   def main(args: Array[String]): Unit = {

      object Student extends Enumeration {
         val first = Value("Nguyen Ngoc Hung")
         val second = Value("Vo Thanh Hung")
         val third = Value("Nguyen Trung Truc")
         val four = Value("Hoang Van Hung")
         val fith = Value("Le Duc Anh")

      }
      
      //loop in enum
      for(stu <- Student.values){
         println(stu.id + "  "+ stu)
      }
      
      //use filter
      println("Fileter name : Hung")
      Student.values.filter(_.toString().endsWith("hung")).foreach(println)
   }

}